<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">

    <ui:composition template="/template.xhtml">
        
        <ui:define name="title">
            <h:outputText value="#{bundle.ListFornecedorTitle}"></h:outputText>
        </ui:define>
        
        <ui:define name="menuLateral">
            
            <h:form id="formLateralMenuFornecedorList">
                <h:panelGroup>
                    <p:slideMenu style="width:120px">
                        <p:submenu label="Teste">
                            <p:menuitem value="Teste" />
                        </p:submenu>
                    </p:slideMenu>
                </h:panelGroup>
            </h:form>
            
        </ui:define>
        
        <ui:define name="body">
            <h:form id="formFornecedorList">
                
                <h:panelGroup id="messagePanel" layout="block">
                    <p:growl/>
                </h:panelGroup>
                
                <h:panelGroup>
                    
                    <p:dataTable id="tableFornecedor" value="#{fornecedorController.items}" var="item" 
                                 emptyMessage="#{bundle.ListFornecedorEmpty}" paginator="true" rows="10"
                                 style="border:solid 1px">
                        <f:facet name="header">
                            <h:outputText value="#{bundle.ListFornecedorTitle}"/>
                        </f:facet>
                        <p:column sortBy="#{item.nome}" filterBy="#{item.nome}">
                            <f:facet name="header">
                                <h:outputText style="font-size: x-small" value="#{bundle.ListPessoaTitle_nome}"/>
                            </f:facet>
                            <h:outputText value="#{item.nome}"/>
                        </p:column>
                        <p:column sortBy="#{item.razaoSocial}" filterBy="#{item.razaoSocial}">
                            <f:facet name="header">
                                <h:outputText style="font-size: x-small" value="#{bundle.ListFornecedorTitle_razaoSocial}"/>
                            </f:facet>
                            <h:outputText value="#{item.razaoSocial}"/>
                        </p:column>
                        <p:column sortBy="#{item.cgc}" filterBy="#{item.cgc}">
                            <f:facet name="header">
                                <h:outputText style="font-size: x-small" value="#{bundle.ListPessoaTitle_cgc}"/>
                            </f:facet>
                            <h:outputText value="#{item.cgc}"/>
                        </p:column>
                        <p:column sortBy="#{item.rg}" filterBy="#{item.rg}">
                            <f:facet name="header">
                                <h:outputText style="font-size: x-small" value="#{bundle.ListPessoaTitle_rg}"/>
                            </f:facet>
                            <h:outputText value="#{item.rg}"/> 
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText style="font-size: x-small" value="#{bundle.ListPessoaTitle_EMail}"/>
                            </f:facet>
                            <h:outputText value="#{item.EMail}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText style="font-size: x-small" value="#{bundle.ListPessoaTitle_twitter}"/>
                            </f:facet>
                            <h:outputText value="#{item.twitter}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <h:outputText style="font-size: x-small" value="#{bundle.ListPessoaTitle_facebook}"/>
                            </f:facet>
                            <h:outputText value="#{item.facebook}"/>
                        </p:column>
                        <p:column>
                            <f:facet name="header">
                                <p:commandButton style="font-size: x-small" action="#{fornecedorController.prepareCreate}" value="#{bundle.ListFornecedorCreateLink}" ajax="false"/>
                            </f:facet>
                            <p:commandButton style="font-size: x-small" action="#{fornecedorController.prepareView}" value="#{bundle.ListPessoaViewLink}" ajax="false"/>
                            <p:commandButton style="font-size: x-small" action="#{fornecedorController.prepareEdit}" value="#{bundle.ListPessoaEditLink}" ajax="false"/>
                            <p:commandButton style="font-size: x-small" action="#{fornecedorController.destroy}" value="#{bundle.ListPessoaDestroyLink}" ajax="false"/>
                        </p:column>
                    </p:dataTable>
                    
                </h:panelGroup>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
